import request from "../../request";
import { type R, type DeepRequired } from "../../interface";
import { type AxiosRequestConfig } from "axios";

/**
 * 分页获取 Users 信息
 * /users/page
 */
export function getUsersPage(params: GetUsersPageParams, config?: AxiosRequestConfig) {
    const paramsInput = {
        pageNum: params.pageNum,
        pageSize: params.pageSize,
    };
    return request.get<DeepRequired<R>>(`/users/page`, {
        params: paramsInput,
        ...config,
    });
}

export interface GetUsersPageParams {
    /** 页码 */
    pageNum: number;
    /** 每页数量 */
    pageSize: number;
}
